<?php

namespace App\Http\Requests\Administrator;


class MainGamePlatRequest extends Request
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {

        switch ($this->method()) {
            // CREATE
            case 'POST':
                {
                    return [
                        'main_game_plat_name' => 'required|min:2|max:32',
                        'main_game_plat_code' => 'required|min:2|max:32|alpha_dash',
                        'status' => 'required|in:0,1',
                        'rate' => 'required|between:0,1.0|numeric',
                    ];
                }
            // UPDATE
            case 'PUT':
            case 'PATCH':
                {
                    return [
                        'status' => 'required|in:0,1',
                        'rate' => 'required|between:0,1.0|numeric',
                    ];
                }
            case 'GET':
            case 'DELETE':
            default:
                {
                    return [];
                };
        }
    }
}
